package easymusic.baseutility;

import java.util.HashMap;

import com.easymusic.R;

import easymusic.baseinterface.IAppDataService;
import android.content.Context;
import android.graphics.BitmapFactory;

class EasyMusicAppDataService extends AbstractService implements IAppDataService{
	private HashMap<String, Object> m_hashData = new HashMap<String, Object>();
	
	public EasyMusicAppDataService(){
		
	}
	
	@Override
	public void startService(EasyMusicAppService service, Context context) {
		// TODO Auto-generated method stub
		m_hashData.put(APP_CONTEXT, context);
		m_hashData.put(APP_SERVICE, service);
		m_hashData.put(APP_DEFAULT_ICON, BitmapFactory.decodeResource(context.getResources(), R.drawable.easy_music_icon));
	}

	@Override
	public void stopService() {
		// TODO Auto-generated method stub
		EasyMusicAppService service = (EasyMusicAppService)m_hashData.get(APP_SERVICE);
		if (null != service){
			service.stopSelf();
		}
	}

	@Override
	public Object getAppData(String strDataName) {
		return m_hashData.get(strDataName);
	}

	@Override
	public void setAppData(String strDataName, Object obj) {
		// TODO Auto-generated method stub
		m_hashData.put(strDataName, obj);
	}

	@Override
	public Object getAppProperty(String strDataName) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void setAppProperty(String strDataName, Object obj) {
		// TODO Auto-generated method stub
		
	}

}
